<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
</head>
<body unselectable="on" onselectstart="return false;">

<link rel="stylesheet" href="../lib/jquery-ui/themes/base/core.css">
<link rel="stylesheet" href="../lib/jquery-ui/themes/base/menu.css">
<link rel="stylesheet" href="../lib/jquery-ui/themes/base/theme.css">
<link rel="stylesheet" href="../lib/spop-gh-pages/dist/spop.min.css">


<link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" href="../css/view.css">
<link rel="stylesheet" href="../css/tooltip.css">
<link rel="stylesheet" href="../css/loading.css">
<link rel="stylesheet" href="../css/icon.css">
<link rel="stylesheet" href="../css/legend.css">
<link rel="stylesheet" href="../css/overview.css">
<link rel="stylesheet" href="../css/node.css">

<script src="../lib/lodash/lodash-4.17.11.min.js"></script>
<script src="../lib/ui/ui.js"></script>
<script src="../lib/jquery/dist/jquery.min.js"></script>
<script src="../lib/jquery-ui/dist/jquery-ui.js"></script>
<script src="../lib/spop-gh-pages/dist/spop.min.js"></script>

<script src="../lib/jquery-confirm/jquery-confirm.min.js"></script>

<script src="../lib/signals/dist/signals.js"></script>
<script src="../lib/reqwest/reqwest.js"></script>

<script src="../lib/three/build/three_v2.js"></script>
<script src="../lib/tween.js/src/Tween.js"></script>
<script src="../lib/rasterizeHTML.allinone.js"></script>
<script src="../js/config.js"></script>
<script src="../js/idc_visual.js" type="text/javascript"></script>
<script src="../js/jquery.cookie.js" type="text/javascript"></script>
<script src="../js/rasterizeHTML.allinone.js"></script>
<script src="../js/iv_node_options.js" type="text/javascript"></script>
<script src="../js/iv_interface.js" type="text/javascript"></script>

<script src="../data/editor.js"></script>
<script src="../data/menu.js"></script>


<div id="percent"></div>
<div id="iv"></div>
<script>
    $(function(){
        var params = window.parent.ev_room2d_interface_getParams();
	console.log('window.parent.ev_room2d_interface_getParams()', params);
	console.log('window.parent.ev_room2d_interface_getParams()', JSON.stringify(params));
        var editor = new IV.Editor({
            getGraphDataUrl: params.host+"/graphData/showRoomAll?roomCode="+params.roomCode,
            getTipsUrl: params.host+"/graphData/tips/"+params.roomCode+"/{uuid}/{type}/{id}",
            getFilterUrl: params.host+"/graphData/graphFilter/"+params.roomCode,
            getLegendUrl: params.host+"/graphData/graphLegend/0/"+params.roomCode
        });
        window.editor = editor;
        editor.setRenderContainer(document.getElementById("iv"));

        var menubar = new IV.Menubar(editor);
        new IV.Menu(editor);
        new IV.TooltipManage(editor);
        new IV.Legend(editor,menubar);
        new IV.Filter(editor,menubar);
        new IV.Loading(editor);
        // new IV.Overview(editor);

        var viewport = new IV.Viewport(editor);

        var playGround = new IV.EditablePlayGround(editor,viewport.dom);
        playGround.build();

        editor.signals.openEdit.add(function(){
           window.parent.ev_room2d_interface_openEditor();
        });
        if (params.exportPicFlag == 'false'){
            window.iv_config_params.allowExportImg = false;
        }
        if (params.exportExcelFlag == 'false'){
            window.iv_config_params.exportMenu.splice(0,window.iv_config_params.exportMenu.length);
        }

        editor.init();
    })

</script>
</body>
</html>
